package chapter01.d06;
/**
 * 异常捕获后，线程会继续执行
 * @author kenneth
 *
 */
public class ExceptionTask2 implements Runnable{
	@Override
    public void run() {
        for (int idx = 1; idx <= 10; idx++) {
            System.out.println("子线程：我还活着" + idx);
            
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            
            if (idx == 5) {
            	//System.out.println(5/0);
                try {
					System.out.println(5/0);
				} catch (RuntimeException e) {
					e.printStackTrace();
				}
            }
        }
    }
}
